package com.platform.common.aspectj;

/**
 * 系统日志枚举
 */
public enum SysLogEnum {

    /**
     * 登录
     */
    LOGIN(1, "登录"),
    /**
     * 其他
     */
    OTHER(99, "其他");

    private Integer code;
    private String name;

    // 构造方法
    SysLogEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static SysLogEnum fromCode(Integer code) {
        for (SysLogEnum logEnum : SysLogEnum.values()) {
            if (code.equals(logEnum.code)) {
                return logEnum;
            }
        }
        return SysLogEnum.OTHER;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
